package com.xbao.dao;

import com.xbao.model.NotifySetting;
import com.xbao.model.NotifySettingExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

@Mapper
public interface NotifySettingMapper {
    @SelectProvider(type=NotifySettingSqlProvider.class, method="countByExample")
    int countByExample(NotifySettingExample example);

    @DeleteProvider(type=NotifySettingSqlProvider.class, method="deleteByExample")
    int deleteByExample(NotifySettingExample example);

    @Delete({
        "delete from notifySetting",
        "where orgid = #{orgid,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long orgid);

    @Insert({
        "insert into notifySetting (orgid, updatetime, ",
        "createtime, lineset, ",
        "endrecordset, leaveset, ",
        "subset)",
        "values (#{orgid,jdbcType=BIGINT}, #{updatetime,jdbcType=BIGINT}, ",
        "#{createtime,jdbcType=BIGINT}, #{lineset,jdbcType=INTEGER}, ",
        "#{endrecordset,jdbcType=INTEGER}, #{leaveset,jdbcType=INTEGER}, ",
        "#{subset,jdbcType=INTEGER})"
    })
    int insert(NotifySetting record);

    @InsertProvider(type=NotifySettingSqlProvider.class, method="insertSelective")
    int insertSelective(NotifySetting record);

    @SelectProvider(type=NotifySettingSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="orgid", property="orgid", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="updatetime", property="updatetime", jdbcType=JdbcType.BIGINT),
        @Result(column="createtime", property="createtime", jdbcType=JdbcType.BIGINT),
        @Result(column="lineset", property="lineset", jdbcType=JdbcType.INTEGER),
        @Result(column="endrecordset", property="endrecordset", jdbcType=JdbcType.INTEGER),
        @Result(column="leaveset", property="leaveset", jdbcType=JdbcType.INTEGER),
        @Result(column="subset", property="subset", jdbcType=JdbcType.INTEGER)
    })
    List<NotifySetting> selectByExample(NotifySettingExample example);

    @Select({
        "select",
        "orgid, updatetime, createtime, lineset, endrecordset, leaveset, subset",
        "from notifySetting",
        "where orgid = #{orgid,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="orgid", property="orgid", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="updatetime", property="updatetime", jdbcType=JdbcType.BIGINT),
        @Result(column="createtime", property="createtime", jdbcType=JdbcType.BIGINT),
        @Result(column="lineset", property="lineset", jdbcType=JdbcType.INTEGER),
        @Result(column="endrecordset", property="endrecordset", jdbcType=JdbcType.INTEGER),
        @Result(column="leaveset", property="leaveset", jdbcType=JdbcType.INTEGER),
        @Result(column="subset", property="subset", jdbcType=JdbcType.INTEGER)
    })
    NotifySetting selectByPrimaryKey(Long orgid);

    @UpdateProvider(type=NotifySettingSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") NotifySetting record, @Param("example") NotifySettingExample example);

    @UpdateProvider(type=NotifySettingSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") NotifySetting record, @Param("example") NotifySettingExample example);

    @UpdateProvider(type=NotifySettingSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(NotifySetting record);

    @Update({
        "update notifySetting",
        "set updatetime = #{updatetime,jdbcType=BIGINT},",
          "createtime = #{createtime,jdbcType=BIGINT},",
          "lineset = #{lineset,jdbcType=INTEGER},",
          "endrecordset = #{endrecordset,jdbcType=INTEGER},",
          "leaveset = #{leaveset,jdbcType=INTEGER},",
          "subset = #{subset,jdbcType=INTEGER}",
        "where orgid = #{orgid,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(NotifySetting record);
}